package top.xierongsheng.user.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Data;
import lombok.experimental.Accessors;
import top.xierongsheng.user.dto.groups.Create;
import top.xierongsheng.user.dto.groups.Update;
import top.xierongsheng.user.dto.groups.UpdateStatus;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

/**
 * 商品Dto
 *
 * @auther 谢荣生
 * @datetime 2021/1/4 9:49
 */
@Data
@Schema(description = "商品数据Dto")
@Accessors(chain = true)
public class GoodsDto implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "商品ID")
    @NotBlank(message = "商品id不能为空", groups = {Update.class, UpdateStatus.class})
    private String id;

    @Schema(description = "商品名称")
    @NotBlank(message = "商品名称不能为空", groups = {Create.class, Update.class})
    private String name;

    @Schema(description = "商品类型")
    @NotBlank(message = "商品类型不能为空", groups = {Create.class, Update.class})
    private String type;

    @Schema(description = "商品状态")
    @NotBlank(message = "状态值不能为空", groups = UpdateStatus.class)
    private int status;

    @Schema(description = "商品参与活动开始时间")
    @NotNull(message = "活动开始时间不能为空", groups = {Create.class, Update.class})
    private Date startTime;

    @Schema(description = "商品参与活动结束时间")
    @NotNull(message = "活动结束时间不能为空", groups = {Create.class, Update.class})
    private Date endTime;

    @Schema(description = "商品图")
    @NotBlank(message = "商品展示图不能为空", groups = {Create.class, Update.class})
    private String picture;
}
